package com.atguigu.daijia.order.service;

import com.atguigu.daijia.model.entity.order.OrderInfo;
import com.atguigu.daijia.model.form.order.OrderInfoForm;
import com.atguigu.daijia.model.form.order.StartDriveForm;
import com.atguigu.daijia.model.form.order.UpdateOrderBillForm;
import com.atguigu.daijia.model.form.order.UpdateOrderCartForm;
import com.atguigu.daijia.model.vo.base.PageVo;
import com.atguigu.daijia.model.vo.order.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

/**
 * @author 谢忠涵7
 */
public interface OrderInfoService extends IService<OrderInfo> {

    /**
     * @description: 保存订单信息
     * @author: xiaoxie
     * @date: 2024/10/26 22:08
     * @param: [orderInfoForm] 订单相关的信息
     * @return: 订单id
     **/
    Long saveOrderInfo(OrderInfoForm orderInfoForm);

    /**
     * @description: 根据订单id获取订单状态
     * @author: xiaoxie
     * @date: 2024/10/26 22:36
     * @param: [orderId] 订单id
     * @return: 订单状态
     **/
    Integer getOrderStatus(Long orderId);

    /**
     * @description: 司机抢单
     * @author: xiaoxie
     * @date: 2024/10/28 21:53
     * @param: [driverId, orderId] 司机id 订单id
     * @return: java.lang.Boolean
     **/
    Boolean robNewOrder(Long driverId, Long orderId);
    /**
     * @description: 乘客端查找当前订单
     * @author: xiaoxie
     * @date: 2024/10/29 14:04
     * @param: [customerId] 乘客id
     * @return: CurrentOrderInfoVo
     **/
    CurrentOrderInfoVo searchCustomerCurrentOrder(Long customerId);

    /**
     * @description: 司机端查找当前订单
     * @author: xiaoxie
     * @date: 2024/10/29 14:04
     * @param: [customerId] 司机id
     * @return: CurrentOrderInfoVo
     **/
    CurrentOrderInfoVo searchDriverCurrentOrder(Long driverId);

    /**
     * @description: 司机到达起始点后修改订单信息
     * @author: xiaoxie
     * @date: 2024/10/29 15:10
     * @param: [orderId, driverId]
     * @return: java.lang.Boolean
     **/
    Boolean driverArriveStartLocation(Long orderId, Long driverId);

    /**
     * @description: 更新代驾车辆信息
     * @author: xiaoxie
     * @date: 2024/10/29 15:21
     * @param: [updateOrderCartForm]
     * @return: java.lang.Boolean
     **/
    Boolean updateOrderCart(UpdateOrderCartForm updateOrderCartForm);

    /**
     * @description: 开始代驾服务 修改订单状态
     * @author: xiaoxie
     * @date: 2024/10/30 19:32
     * @param: [startDriveForm]
     * @return: java.lang.Boolean
     **/
    Boolean startDrive(StartDriveForm startDriveForm);

    /**
     * @description: 根据时间段获取订单数
     * @author: xiaoxie
     * @date: 2024/10/30 21:37
     * @param: [startTime, endTime]
     * @return: java.lang.Long
     **/
    Long getOrderNumByTime(String startTime, String endTime);

    /**
     * @description: 结束代驾服务更新订单账单
     * @author: xiaoxie
     * @date: 2024/10/30 21:50
     * @param: [updateOrderBillForm]
     * @return: java.lang.Boolean
     **/
    Boolean endDrive(UpdateOrderBillForm updateOrderBillForm);

    /**
     * @description: 获取乘客订单分页列表
     * @author: xiaoxie
     * @date: 2024/11/1 10:12
     * @param: [pageParam, customerId]
     * @return: com.atguigu.daijia.model.vo.base.PageVo
     **/
    PageVo findCustomerOrderPage(Page<OrderInfo> pageParam, Long customerId);

    /**
     * @description: 获取司机订单分页列表
     * @author: xiaoxie
     * @date: 2024/11/1 10:28
     * @param: [pageParam, driverId]
     * @return: com.atguigu.daijia.model.vo.base.PageVo
     **/
    PageVo findDriverOrderPage(Page<OrderInfo> pageParam, Long driverId);

    /**
     * @description: 根据订单id获取实际账单信息
     * @author: xiaoxie
     * @date: 2024/11/1 11:19
     * @param: [orderId]
     * @return: OrderBillVo
     **/
    OrderBillVo getOrderBillInfo(Long orderId);

    /**
     * @description: 根据订单id获取实际分账信息
     * @author: xiaoxie
     * @date: 2024/11/1 11:24
     * @param: [orderId]
     * @return: com.atguigu.daijia.model.vo.order.OrderProfitsharingVo
     **/
    OrderProfitsharingVo getOrderProfitsharing(Long orderId);

    /**
     * @description: 发送账单信息 即修改订单状态即可
     * @author: xiaoxie
     * @date: 2024/11/1 11:39
     * @param: [orderId, driverId]
     * @return: java.lang.Boolean
     **/
    Boolean sendOrderBillInfo(Long orderId, Long driverId);

    /**
     * @description: 获取订单支付信息
     * @author: xiaoxie
     * @date: 2024/11/1 16:57
     * @param: [orderNo, customerId]
     * @return: OrderPayVo
     **/
    OrderPayVo getOrderPayVo(String orderNo, Long customerId);

    /**
     * 取消订单
     */
    void cancelOrder(long orderId);
}
